#include "Assignment.h"

Assignment::Assignment()
{
}

Assignment::Assignment(int number, QDate date)
{
    this->number = number;
    this->dueDate = date;
}

int Assignment::getNumber() const
{
    return this->number;
}

QDate Assignment::getDate() const
{
    return this->dueDate;
}

void Assignment::setNumber(int newNumber)
{
    number=newNumber;
}

void Assignment::setDate(QDate date)
{
    dueDate=date;
}

QDataStream &operator<<(QDataStream &out, const Assignment &data)
{
    out << quint32(data.getNumber()) << data.getDate();
    return out;
}

QDataStream &operator>>(QDataStream &in, Assignment &data)
{
    quint32 number;
    QDate date;
    in >> number >> date;
    data = Assignment(number, date);
    return in;
}
